package com.example.yunJie.digitalSentry.mapper.one;

import com.example.yunJie.digitalSentry.entity.RecognitionEntity;
import org.apache.ibatis.annotations.*;

import java.io.Serializable;
import java.util.List;


public interface RecognitionMapper {

//    @Insert("insert into recognition(dev_sno,token,person_id,person_name,person_temperature,person_type,\n" +
//            "                                capture_img,capture_score,capture_status,capture_time,card_type,cmp_type)\n" +
//            "        values (#{dev_sno},#{token},#{person_id},#{person_name},#{person_temperature},#{person_type},\n" +
//            "                #{capture_img},#{capture_score},#{capture_status},#{capture_time},#{card_type},#{cmp_type})")
    int insert(RecognitionEntity recognitionEntity);

//    @Update("update recognition set " +
//            "dev_sno = #{dev_sno},token = #{token},person_id = #{person_id},person_name = #{person_name}," +
//            "person_temperature = #{person_temperature},person_type = #{person_type}," +
//            "capture_img = #{capture_img},capture_score = #{capture_score},capture_status = #{capture_status}," +
//            "capture_time = #{capture_time},card_type = #{card_type},cmp_type = #{cmp_type} where id = #{id} ")
    int update(RecognitionEntity recognitionEntity);

//    @Delete("delete from recognition where id = #{Id}")
    int deleteById(Serializable id);

//    @Delete("<script>" +
//            "delete from recognition where id in\n" +
//            "        <foreach collection=\"list\" item=\"id\" open=\"(\" separator=\",\" close=\")\">\n" +
//            "            #{id}\n" +
//            "        </foreach>" +
//            "</script>")
    int deleteIdList(List<Integer> idList);

//    @Select("select  dev_sno,token,person_id,person_name,person_temperature,person_type,\n" +
//            "                capture_img,capture_score,capture_status,capture_time,card_type,cmp_type\n" +
//            "        from recognition\n" +
//            "        where id = #{id}")
    RecognitionEntity findId(Serializable id);

//    @Select("select * from recognition")
    List<RecognitionEntity> findAll();
//    @Select("<script>select * from recognition " +
//            "<where>\n" +
//            "            <if test=\"capture_time != null and capture_time != ''\">capture_time like concat('%', #{capture_time}, '%')</if>\n" +
//            "        </where>" +
//            "</script>")
    List<RecognitionEntity> findAllByCapture_time(String s);

}
